package com.woniuxy.controller;

import com.woniuxy.entity.ResponseEntity;
import com.woniuxy.service.StudentAdministrationService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author：jojo
 * @Date：2022/3/11 17:09
 * @Description :TODO
 */
@RestController
@RequestMapping("/study")
public class StudentAdministrationController {
    @Autowired(required = false)
    StudentAdministrationService studentAdministrationService;

    @ApiOperation(value = "查询所有用户")
    @RequestMapping("/findAll")
    public ResponseEntity findAll(){
        return studentAdministrationService.findAll();
    }

    @ApiOperation(value = "查询某一个用户的详情")
    @RequestMapping("/findOneUser/{id}")
    public ResponseEntity findOneUser(@PathVariable("id") int id){
        return studentAdministrationService.findOneUser(id);
    }

    @ApiOperation(value = "查询该用户的能力值")
    @RequestMapping("/findSkill/{id}")
    public ResponseEntity findSkill(@PathVariable("id") int id){
        return studentAdministrationService.findSkill(id);
    }
    @ApiOperation(value = "查询")
    @RequestMapping("/findSearch/{id}/{trainingname}")
    public ResponseEntity findSearch(@PathVariable("id") int id,@PathVariable("trainingname") String trainingname){

        return studentAdministrationService.findSearch(id,trainingname);
    }
}
